library(tidyverse)
library(sjlabelled)

gp_covid <- 
  read_csv2("./data/ZA5667_v1-1-0.csv") %>%
  set_na(na = c(-99, -77, -33, 98))

1

Use across() to dichotomize the trust variables hzcy044a:hzcy052a. The value 1 should remain, all others should be 0.
You have to wrap it into the mutate() function and then use recode().

2

Please check if all went as expected.

There are several ways of doing that.

  1. Either print tables like on the slides using the table() function.
  2. Or use select() to select only the manipulated columns and print the whole data frame using View(), glimpse() or the plain console output.

3

Use the median() function to calculate an aggregated variable of all trust variables for all observations in the data.
For this task you need to first use rowwise() on your data and calculate the values, amongst others, applying the c_across() function. Oh, and don’t forget to finally use ungroup.